package wjw.mapper;

import com.wjw.mapper.EvaluateGradeTableMapper;
import com.wjw.model.Evaluate_grade_table;
import com.wjw.utils.GetSqlSessionUtils;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

import java.util.List;

public class EvaluateGradeTable {

    private SqlSession sqlsession= GetSqlSessionUtils.getSqlSession();
    private EvaluateGradeTableMapper mapper=sqlsession.getMapper(EvaluateGradeTableMapper.class);


    @Test
    public void test01(){
        List<Evaluate_grade_table> all1 = mapper.findAll();
        System.out.println(all1);
    }

    @Test
    public void test02(){
        Evaluate_grade_table evaluate_grade_table = new Evaluate_grade_table();
        evaluate_grade_table.setEvaluate_grade_name("E");
        mapper.add(evaluate_grade_table);
        sqlsession.commit();
    }

    @Test
    public void test03(){
        Evaluate_grade_table evaluate_grade_table = new Evaluate_grade_table();
        evaluate_grade_table.setEvaluate_grade_name("F");
        evaluate_grade_table.setEvaluate_grade_id(5);
        mapper.change(evaluate_grade_table);
        sqlsession.commit();
    }

    @Test
    public void test04(){
        List<Evaluate_grade_table> byPage = mapper.findByPage(0, 1);
        System.out.println(byPage);
    }
}
